#ifndef LRAD_HEAP_H
#define LRAD_HEAP_H

/*
 * heap.h	Structures and prototypes for binary heaps.
 * Version:	$Id$
 *
 * Copyright 2007 Alan DeKok
 * Concurrent enable 2013 by Michael Moore <lyxmoo@msn.com>
 */

#ifdef __cplusplus
extern "C" {
#endif

	typedef int (*lru_heap_cmp_t) (const void *, const void *);

	typedef struct lru_heap_t lru_heap_t;
	lru_heap_t *lru_heap_create(lru_heap_cmp_t cmp, size_t offset);
	void lru_heap_delete(lru_heap_t * hp);

	int lru_heap_insert(lru_heap_t * hp, void *data);
	int lru_heap_extract(lru_heap_t * hp, void *data);
	void *lru_heap_peek(lru_heap_t * hp);
	int lru_heap_num_elements(lru_heap_t * hp);

#ifdef __cplusplus
}
#endif
#endif								  /* LRAD_HEAP_H */
